package com.zh.filetransport

import com.zh.filetransport.chat.CreateChatService
import com.zh.filetransport.contrl.StdInput
import com.zh.filetransport.core.NewFileService
import com.zh.filetransport.model.Mode
import kotlin.concurrent.thread

/**
 *
 * @author Zhou
 * @date 2:04 2025/5/31
 */

/*
fun main() {
    val mode = "console"


}*/

fun main() {
    val mode = Mode.Console.name

    val service = NewFileService(8181, mode)
    service.start()//启动文件服务

    val chatService = CreateChatService(8183)
    chatService.start { it -> println("收到来自[${it.second}]的消息: ${it.first}") }

    thread {
        StdInput(mode, service, chatService)
    }

    println("main end.")
}